package cn.wolfcode.mapper;

import cn.wolfcode.domain.Notice;
import cn.wolfcode.qo.QueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface NoticeMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Notice record);

    Notice selectByPrimaryKey(Long id);

    List<Notice> selectAll();

    int updateByPrimaryKey(Notice record);

    List<Notice> selectForList(QueryObject qo);

    //往中间插入关联关系
    void saveRead(@Param("nid") Long id, @Param("eid") Long eid);

    //修改发布状态
    void updataStatus(@Param("id") Long id, @Param("status") boolean status);

    //修改已读状态
    void updateRead(@Param("nid") Long aLong, @Param("eid") Long id, @Param("read") Boolean read);

    //根据当前用户id查找他未读公告的数量
    int selectCount(Long eid);

    //根据当前用户id查找他未读公告的内容
    List<Notice> selectByIdNotice(Long eid);
}